package com.zekdot.logserver.mq;

import com.zekdot.logserver.writer.LogWriter;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Create by zekdot on 20-3-19.
 */
@Component
@RabbitListener(queues = "LogQueue")
public class LogReciver {

    @RabbitHandler
    public void process(Map map){
//        System.out.println("收到日志 " + map.toString());
        LogWriter.writeLog(map.get("content").toString(), (Integer) map.get("type"));
    }
}
